<html>
<head>
    <meta charset='utf-8'>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">
    <link type="text/css" rel="stylesheet" href="static/js/plugin/bootstrap/css/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="static/css/font.awesome/css/font-awesome.min.css" />
    <link rel="stylesheet" type="text/css" href="static/css/common.css" />
    <title>欢迎页面</title>
</head>

<body class="main-box">
	<div class="container">
		<div class="row">
			<div class="col-md-6">
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">
							柱状图示例
						</div>
					</div>
					<div class="panel-body">
						<div id="barChart" style="width:400px;height:400px;"></div>
					</div>
				</div>
			</div>
			<div class="col-md-6">
				<div class="panel panel-default">
					<div class="panel-heading">
						<div class="panel-title">
							饼状图示例
						</div>
					</div>
					<div class="panel-body">
						<div id="pieChart" style="width:400px;height:400px;"></div>
					</div>
				</div>
			</div>
		</div>
	</div>
</body>
<script src="static/js/plugin/jquery/jquery.min.js"></script>
<script src="static/js/plugin/bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="static/js/plugin/echart/echarts.min.js"></script>
<script type="text/javascript">
	var myChart = echarts.init(document.getElementById('barChart'));
        // 指定图表的配置项和数据
        var option = {
            title: {
                text: 'ECharts 入门示例'
            },
            tooltip: {},
            legend: {
                data:['销量']
            },
            xAxis: {
                data: ["衬衫","羊毛衫","雪纺衫","裤子","高跟鞋","袜子"]
            },
            yAxis: {},
            series: [{
                name: '销量',
                type: 'bar',
                data: [5, 20, 36, 10, 10, 20]
            }]
        };
        // 使用刚指定的配置项和数据显示图表。
        myChart.setOption(option);

var pieOption = {
    title : {
        text: '某站点用户访问来源',
        subtext: '纯属虚构',
        x:'center'
    },
    tooltip : {
        trigger: 'item',
        formatter: "{a} <br/>{b} : {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        left: 'left',
        data: ['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series : [
        {
            name: '访问来源',
            type: 'pie',
            radius : '55%',
            center: ['50%', '60%'],
            data:[
                {value:335, name:'直接访问'},
                {value:310, name:'邮件营销'},
                {value:234, name:'联盟广告'},
                {value:135, name:'视频广告'},
                {value:1548, name:'搜索引擎'}
            ],
            itemStyle: {
                emphasis: {
                    shadowBlur: 10,
                    shadowOffsetX: 0,
                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
            }
        }
    ]
};
var pieChart = echarts.init(document.getElementById('pieChart'));
 pieChart.setOption(pieOption);
</script>
</html>